<template>
  <div class="backjs">
    <div class="dialog">
      <header>
        <span>{{ name }}商品</span>
        <svg-icon iconClass="x" @click="records"></svg-icon>
      </header>
      <main>
        <div class="dialog_one">
          <div class="imgs">
            <b>{{ name }}图片：</b> <img :src="form.url" alt="" />
          </div>
          <div class="">
            <b>{{ name }}ID：</b> {{ form.id }}
          </div>
          <div>
            <b> {{ name }}名称：</b>{{ form.name }}
          </div>
          <div><b> 商品介绍：</b>{{ form.recommend }}</div>
          <div>
            <b> {{ name }}价格：</b>{{ form.price }}
          </div>
          <div><b> 共拼图数：</b>{{ form.introduce }}</div>
          <div>
            <b> 剩{{ name }}数：</b>{{ form.residue }}
          </div>
          <div><b> 开始时间： </b>{{ form.begin }}</div>
          <div><b> 结束时间：</b>{{ form.finish }}</div>
          <div>
            <b> {{ name }}状态：</b>{{ form.state }}
          </div>

          <div class="dialog_button">
            <el-button type="primary" @click="onSubmit()">确定</el-button>
          </div>
        </div>
      </main>
    </div>
  </div>
</template>

<script>
export default {
  props: ["newList", "name"],
  data() {
    return {
      form: {},
    };
  },
  created() {
    this.form = this.newList;
  },
  methods: {
    records() {
      this.$emit("isShow", false);
    },
    onSubmit() {
      this.$emit("isShow", false);
    },
  },
};
</script>

<style lang="scss" scoped>
.backjs {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  background: rgba(0, 0, 0, 0.2);
  .dialog {
    width: 450px;
    height: 580px;
    background: #fff;
    z-index: 9999;
    // margin-top: 100px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -40%);
    padding: 10px;
    box-shadow: 0 0 12px 6px #9d9b9b;
    display: flex;
    flex-direction: column;

    header {
      width: 100%;
      height: 50px;
      border-bottom: 1px solid #f6f7f8;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px;
      margin-bottom: 20px;
      span {
        color: #c2c4c7;
        font-weight: bold;
        font-size: 16px;
      }
    }
    main {
      flex: 1;
      overflow: auto;
      .dialog_one {
        width: 100%;
        height: 100%;
        padding-left: 15%;
        padding-right: 10%;

        div {
          display: flex;
          width: 100%;
          height: auto;
          align-items: center;
          margin-bottom: 16px;
        }
        .imgs {
          width: 100%;
          img {
            width: 70px;
            height: 70px;
          }
        }
        .dialog_button {
          padding-left: 40%;
        }
      }

      .buttonss {
        padding-left: 210px;
        text-align: center;
      }
    }
  }
}
</style>